package com.learn.springcloud.configserviceconsumer.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Time : 2018/8/14 16:52
 * @Version : 1.0
 */
@RefreshScope
@RestController
public class HelloConsumer {

    @Value(value = "${env}")
    private String env;

    @Value(value = "${username}")
    private String username;

    @Value(value = "${password}")
    private String password;

    @RequestMapping("/config/service/consumer/test1")
    public String test1(){
        return "env: " + this.env + "\n username:" + this.username + "\n password:" + this.password;
    }

}
